import {updatePwd} from "../services/users";
import {message} from "antd";

export default {
  namespace: 'userPwd',
  state: {
    phone:null,
    canInputCode: false,
    code:null,
    wxAccount: {},
    hasBindWx: '',
    wxError:'',
    wxMessage: '打开微信扫一扫',
    bindToken: '',
  },
  reducers: {
    modifyState(state, { payload: options }) {
      return {...state, ...options};
    },
  },
  effects: {
    *updatePwd({ payload: values }, { call }) {
      const data = yield call(updatePwd, values);
      // console.log(data);
      if(data) {
        message.success(data.message);
      }
    },
  },
  subscriptions: {
  }
}
